package com.parenting.feigncontroller;

import cn.hutool.core.bean.BeanUtil;
import com.parenting.entities.ParentingShopDO;
import com.parenting.feign.controller.IFeignSystemShopController;
import com.parenting.feign.entities.ParentingShopDTO;
import com.parenting.service.ParentingShopService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class FeignShopController implements IFeignSystemShopController {

    @Autowired
    private ParentingShopService  parentingShopService;

    @Override
    public ParentingShopDTO getShopByShopsId(String shopId) {
        log.info("getShopByShopId====> {}",shopId);
        ParentingShopDO byId = parentingShopService.getById(shopId);
        if (null!=byId){
            return BeanUtil.copyProperties(byId, ParentingShopDTO.class);
        }
        return null;
    }
}
